home *** CD-ROM | disk | FTP | other *** search
/ Elite College Girls 1 / Elite College Girls - Volume 1.iso / pc / shared.dir / 01958.ls < prev    next >
Encoding:
Text File  |  1996-02-02  |  6.9 KB  |  200 lines

  1. global gBigBalloon, gBDropSprite, gOldSpot, gSpotLightFrame, gBalloons, gBalloonsList, gReturnFrame, gUserLevel, gCursorSprite, gSlowMachine, cHotCursor, cGeneralCursor, gHot, gHotMask, gTokens, gTokenSprite, gStartDarts
  2.  
  3. on fnc startPoint, endPoint, whichStep
  4.   if whichStep < 1 then
  5.     set whichStep to 1
  6.   end if
  7.   return endPoint - ((endPoint - startPoint) / whichStep)
  8. end
  9.  
  10. on updateDart whichSprite, whichDart, userH, userV, destinationH, destinationV, whichValue
  11.   set the loc of sprite whichSprite to point(fnc(userH, destinationH, whichValue), fnc(userV, destinationV, whichValue))
  12.   updateStage()
  13. end
  14.  
  15. on returnCursor
  16.   set userH to the mouseH
  17.   set userV to the mouseV
  18.   set origLoc to the loc of sprite gCursorSprite
  19.   set newLoc to point(userH, userV)
  20.   slidePiece(gCursorSprite, origLoc, newLoc, 15)
  21. end
  22.  
  23. on movePiece whichSprite, whichSprite2, numberOfPieces, snapDistance, spriteOffset1, spriteOffset2, whichSound
  24.   set userH to the mouseH
  25.   set userV to the mouseV
  26.   set offsetH to userH - the locH of sprite whichSprite
  27.   set offsetV to userV - the locV of sprite whichSprite
  28.   set theForeColor to the foreColor of sprite whichSprite
  29.   set activateScript to setActivateScript(whichSprite, whichSprite2)
  30.   do(activateScript)
  31.   set the foreColor of sprite whichSprite2 to theForeColor
  32.   puppetSprite(whichSprite, 1)
  33.   set the locV of sprite whichSprite to -500
  34.   updateStage()
  35.   repeat while the mouseDown
  36.     set userH to the mouseH
  37.     set userV to the mouseV
  38.     set origLoc to the loc of sprite whichSprite2
  39.     set newLoc to point(userH - offsetH, userV - offsetV)
  40.     slidePiece(whichSprite2, origLoc, newLoc, 3)
  41.   end repeat
  42.   playSound(whichSound)
  43.   set gUserLevel to checkRange(gUserLevel, 1, 3)
  44.   set numberOfMatches to 0
  45.   set numberOfPieces to getAt(numberOfPieces, gUserLevel)
  46.   set snapDistance to getAt(snapDistance, gUserLevel)
  47.   set the loc of sprite whichSprite to the loc of sprite whichSprite2
  48.   deactivate([whichSprite2])
  49.   updateStage()
  50.   repeat with x = 1 to numberOfPieces
  51.     set whichSprite to x + spriteOffset1
  52.     if the type of sprite whichSprite > 0 then
  53.       set distanceH to abs(the locH of sprite whichSprite - the locH of sprite (whichSprite + spriteOffset2))
  54.       set distanceV to abs(the locV of sprite whichSprite - the locV of sprite (whichSprite + spriteOffset2))
  55.       if (distanceH = 0) and (distanceV = 0) then
  56.         set numberOfMatches to numberOfMatches + 1
  57.         next repeat
  58.       end if
  59.       if (distanceH <= snapDistance) and (distanceV <= snapDistance) then
  60.         slidePiece(whichSprite, the loc of sprite whichSprite, the loc of sprite (whichSprite + spriteOffset2), 3)
  61.         set numberOfMatches to numberOfMatches + 1
  62.       end if
  63.     end if
  64.   end repeat
  65.   if numberOfMatches >= numberOfPieces then
  66.     if the frame < label("Ma Barker") then
  67.       playSound("Band Win")
  68.       delayFor(30)
  69.     end if
  70.     go(marker(1))
  71.   else
  72.     go(the frame)
  73.   end if
  74. end
  75.  
  76. on moveTangram whichSprite
  77.   set numberOfPieces to [4, 4, 7]
  78.   set snapDistance to [20, 15, 10]
  79.   movePiece(whichSprite, 37, numberOfPieces, snapDistance, 28, -16, 0)
  80. end
  81.  
  82. on moveBand whichSprite
  83.   set numberOfPieces to [3, 4, 5]
  84.   set snapDistance to [15, 15, 15]
  85.   set newSound to "!" & the name of cast the castNum of sprite whichSprite & " Band"
  86.   movePiece(whichSprite, 23, numberOfPieces, snapDistance, 16, -7, newSound)
  87. end
  88.  
  89. on slidePiece whichSprite, origLoc, newLoc, numberOfSteps
  90.   puppetSprite(whichSprite, 1)
  91.   repeat with x = 1 to numberOfSteps
  92.     set the loc of sprite whichSprite to fnc(origLoc, newLoc, x)
  93.     updateStage()
  94.   end repeat
  95.   set the loc of sprite whichSprite to newLoc
  96.   updateStage()
  97. end
  98.  
  99. on scrollWaldo userH, userV, distance
  100.   set newH to -1
  101.   set newV to -1
  102.   if userH < 10 then
  103.     set newH to checkRange(the locH of sprite gBDropSprite + distance, 205, 307)
  104.   else
  105.     if userH > 502 then
  106.       set newH to checkRange(the locH of sprite gBDropSprite - distance, 205, 307)
  107.     end if
  108.   end if
  109.   if userV < 10 then
  110.     set newV to checkRange(the locV of sprite gBDropSprite + distance, 98, 286)
  111.   else
  112.     if userV > 374 then
  113.       set newV to checkRange(the locV of sprite gBDropSprite - distance, 98, 286)
  114.     end if
  115.   end if
  116.   if newH > 0 then
  117.     set oldH to the locH of sprite gBDropSprite
  118.     set the locH of sprite gBDropSprite to newH
  119.     repeat with x = 1 to 2
  120.       set offsetH to oldH - the locH of sprite (gBDropSprite + x)
  121.       set the locH of sprite (gBDropSprite + x) to newH - offsetH
  122.     end repeat
  123.   end if
  124.   if newV > 0 then
  125.     set oldV to the locV of sprite gBDropSprite
  126.     set the locV of sprite gBDropSprite to newV
  127.     repeat with x = 1 to 2
  128.       set offsetV to oldV - the locV of sprite (gBDropSprite + x)
  129.       set the locV of sprite (gBDropSprite + x) to newV - offsetV
  130.     end repeat
  131.   end if
  132.   go(the frame)
  133. end
  134.  
  135. on gimmeaBalloon whichPos, whichFrame, whichBalloon, now
  136.   set gBigBalloon to 0
  137.   store([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
  138.   if not listp(gBalloonsList) then
  139.     set gBalloonsList to [0, 0, 0, 0]
  140.   end if
  141.   if whichPos <= count(gBalloonsList) then
  142.     if (getAt(gBalloonsList, whichPos) = 0) or now then
  143.       setAt(gBalloonsList, whichPos, 1)
  144.       set gBalloons to checkRange(gBalloons + 1, 1, 4)
  145.       if whichFrame < 1 then
  146.         set gReturnFrame to the frame
  147.       else
  148.         set gReturnFrame to whichFrame
  149.       end if
  150.       if whichBalloon < 1 then
  151.         setProp(1, 40, "puppet", 1)
  152.         setProp(41, 48, "puppet", 0)
  153.         go("Balloons" & gBalloons)
  154.       else
  155.         go(the frame)
  156.       end if
  157.     end if
  158.   end if
  159. end
  160.  
  161. on gimmeaBigBalloon whichPos, whichFrame, now
  162.   if not (the commandDown) then
  163.     set gBigBalloon to whichPos
  164.     store([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
  165.     if whichFrame < 1 then
  166.       set gReturnFrame to the frame
  167.     else
  168.       set gReturnFrame to whichFrame
  169.     end if
  170.     setProp(1, 45, "puppet", 1)
  171.     setProp(46, 48, "puppet", 0)
  172.     go("big balloon")
  173.   end if
  174. end
  175.  
  176. on gimmeaBigBalloon2 whichPos, whichFrame, now
  177.   store([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
  178.   if not listp(gBalloonsList) then
  179.     set gBalloonsList to [0, 0, 0, 0]
  180.   end if
  181.   if whichPos <= count(gBalloonsList) then
  182.     if (getAt(gBalloonsList, whichPos) = 0) or now then
  183.       if whichFrame < 1 then
  184.         set gReturnFrame to the frame
  185.       else
  186.         set gReturnFrame to whichFrame
  187.       end if
  188.       setProp(1, 45, "puppet", 1)
  189.       setProp(46, 48, "puppet", 0)
  190.       go("big balloon")
  191.     end if
  192.   end if
  193. end
  194.  
  195. on returnBalloon
  196.   restore([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40])
  197.   setProp(41, 48, "puppet", 1)
  198.   go(gReturnFrame)
  199. end
  200.